﻿@model IList<NotifyPilot.Models.ServicesConfiguration>

@{
    ViewBag.Title = "ServicesConfig";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>ServicesConfig</h2>
@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
    <table class="table table-striped table-hover">
        <tr>
            <th>
                @Html.DisplayNameFor(model => Model[0].ServiceName)
            </th>
            <th>WorkItem Changed Event</th>
            <th>Checkin Event</th>
            <th>Build Event</th>
        </tr>
        @{
    var i = 0;
    foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.HiddenFor(m => Model[i].ServiceName)
                @Html.DisplayFor(m => Model[i].ServiceName)
            </td>
            @{
        var j = 0;
        foreach (var col in item.EventsClasses)
        {
            <td>
                @Html.CheckBoxFor(m => Model[i].EventsClasses[j].Use)
            </td>
            j++;
        }
            }
        </tr>
        i++;
    }
        }
    </table>
    <div class="form-actions no-color">
        <input type="submit" value="Save" class="btn" />
    </div>
}
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}